package com.momo.mapper.dao;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;
import com.momo.mapper.dataobject.UserPasswordDO;
import com.momo.mapper.mapper.UserPasswordDOMapper;

/**
* The Table USER_PASSWORD.
* 注意:此结构有系统生成,禁止手工修改,以免被覆盖,请通过dalgen生成
* USER_PASSWORD
*/
@Repository
public class UserPasswordDAO{

    @Autowired
    private UserPasswordDOMapper userPasswordDOMapper;

    /**
     * desc:插入表:USER_PASSWORD.<br/>
     * descSql =  SELECT LAST_INSERT_ID() INSERT INTO USER_PASSWORD( ENCRPT_PASSWORD ,USER_ID )VALUES( #{encrptPassword,jdbcType=VARCHAR} ,#{userId,jdbcType=INTEGER} )
     * @param entity entity
     * @return int
     */
    public int insert(UserPasswordDO entity){
        return userPasswordDOMapper.insert(entity);
    }
    /**
     * desc:更新表:USER_PASSWORD.<br/>
     * descSql =  UPDATE USER_PASSWORD SET ENCRPT_PASSWORD = #{encrptPassword,jdbcType=VARCHAR} ,USER_ID = #{userId,jdbcType=INTEGER} WHERE ID = #{id,jdbcType=INTEGER}
     * @param entity entity
     * @return int
     */
    public int update(UserPasswordDO entity){
        return userPasswordDOMapper.update(entity);
    }
    /**
     * desc:根据主键删除数据:USER_PASSWORD.<br/>
     * descSql =  DELETE FROM USER_PASSWORD WHERE ID = #{id,jdbcType=INTEGER}
     * @param id id
     * @return int
     */
    public int deleteById(Integer id){
        return userPasswordDOMapper.deleteById(id);
    }
    /**
     * desc:根据主键获取数据:USER_PASSWORD.<br/>
     * descSql =  SELECT * FROM USER_PASSWORD WHERE ID = #{id,jdbcType=INTEGER}
     * @param id id
     * @return UserPasswordDO
     */
    public UserPasswordDO getById(Integer id){
        return userPasswordDOMapper.getById(id);
    }
}
